/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package com.blw.forethought.DataObjects;


import java.beans.*;
import java.io.Serializable;
import java.util.Date;
import java.util.HashMap;

/**
 *
 * @author bernard_williams
 */
public class Project implements Serializable {

    private PropertyChangeSupport propertySupport;


    //Member variables
    private String projID;
    private String projTitle;
    private String startDate;
    private ScopeOfWork sow;
    private WBSDictionary wbsdictionary;



    
    private class SOW{

    }
    /**
     * @return the wbsdictionary
     */
    public WBSDictionary getWbsdictionary() {
        return wbsdictionary;
    }

    /**
     * @param wbsdictionary the wbsdictionary to set
     */
    public void setWbsdictionary(WBSDictionary wbsdictionary) {
        this.wbsdictionary = wbsdictionary;
    }

    public class WBSDictionary{
        //TODO Build out functionality to manage the WBSDictionary

        private HashMap dictionary;


        /**
         * Constructor for the WBSDictionary Class
         */
        public WBSDictionary(){

            //Initialize the dictionary object
            dictionary = new HashMap();
        }

        /**
         * This method adds a WBS Element Item to the dictionary.  The item
         * should be populated first.
         * @param item WBSElementItem class
         */
        public void addElement(WBSElementItem item){
            int i = dictionary.size() + 1;
            dictionary.put(i,item);
            
        }

        //Remove an item from the dictionary


        //Provide a list of all dictionary items

        public class WBSElementItem{

            private String elementID;
            private String elementName;
            private String description;
            private String completionCriteria;
            private String role;
            private String estimatedDuration;
            private String referenceMaterial;
            private boolean completed;
            private String initials;
            private Date dateCompleted;
            private String remarks;

            /**
             * @return the elementID
             */
            public String getElementID() {
                return elementID;
            }

            /**
             * @param elementID the elementID to set
             */
            public void setElementID(String elementID) {
                this.elementID = elementID;
            }

            /**
             * @return the elementName
             */
            public String getElementName() {
                return elementName;
            }

            /**
             * @param elementName the elementName to set
             */
            public void setElementName(String elementName) {
                this.elementName = elementName;
            }

            /**
             * @return the description
             */
            public String getDescription() {
                return description;
            }

            /**
             * @param description the description to set
             */
            public void setDescription(String description) {
                this.description = description;
            }

            /**
             * @return the completionCriteria
             */
            public String getCompletionCriteria() {
                return completionCriteria;
            }

            /**
             * @param completionCriteria the completionCriteria to set
             */
            public void setCompletionCriteria(String completionCriteria) {
                this.completionCriteria = completionCriteria;
            }

            /**
             * @return the role
             */
            public String getRole() {
                return role;
            }

            /**
             * @param role the role to set
             */
            public void setRole(String role) {
                this.role = role;
            }

            /**
             * @return the estimatedDuration
             */
            public String getEstimatedDuration() {
                return estimatedDuration;
            }

            /**
             * @param estimatedDuration the estimatedDuration to set
             */
            public void setEstimatedDuration(String estimatedDuration) {
                this.estimatedDuration = estimatedDuration;
            }

            /**
             * @return the referenceMaterial
             */
            public String getReferenceMaterial() {
                return referenceMaterial;
            }

            /**
             * @param referenceMaterial the referenceMaterial to set
             */
            public void setReferenceMaterial(String referenceMaterial) {
                this.referenceMaterial = referenceMaterial;
            }

            /**
             * @return the completed
             */
            public boolean isCompleted() {
                return completed;
            }

            /**
             * @param completed the completed to set
             */
            public void setCompleted(boolean completed) {
                this.completed = completed;
            }

            /**
             * @return the initials
             */
            public String getInitials() {
                return initials;
            }

            /**
             * @param initials the initials to set
             */
            public void setInitials(String initials) {
                this.initials = initials;
            }

            /**
             * @return the dateCompleted
             */
            public Date getDateCompleted() {
                return dateCompleted;
            }

            /**
             * @param dateCompleted the dateCompleted to set
             */
            public void setDateCompleted(Date dateCompleted) {
                this.dateCompleted = dateCompleted;
            }

            /**
             * @return the remarks
             */
            public String getRemarks() {
                return remarks;
            }

            /**
             * @param remarks the remarks to set
             */
            public void setRemarks(String remarks) {
                this.remarks = remarks;
            }

        }

    }

    

    private class StatusReport{

    }

    private class CommunicationPlan{

    }

    private class StakeHolderPlan{

    }

    private class QualityPlan{

    }


    
    /**
     * Constructor for the Project class
     */
    public Project(){
       propertySupport = new PropertyChangeSupport(this);
       wbsdictionary = new WBSDictionary();
        
    }



    /**
     * @return the projID
     */
    public String getProjID() {
        return projID;
    }

    /**
     * @param projID the projID to set
     */
    public void setProjID(String projID) {
        String oldValue = this.projID;
        this.projID = projID;
        propertySupport.firePropertyChange("projID", oldValue, this.projID);

    }

    /**
     * @return the projTitle
     */
    public String getProjTitle() {
        return projTitle;
    }

    /**
     * @param projTitle the projTitle to set
     */
    public void setProjTitle(String projTitle) {
        this.projTitle = projTitle;
    }

    /**
     * @return the startDate
     */
    public String getStartDate() {
        return startDate;
    }

    /**
     * @param startDate the startDate to set
     */
    public void setStartDate(String startDate) {
        this.startDate = startDate;
    }
    
    public boolean validateProject(){
        
        return true;
    }




    public void addPropertyChangeListener(PropertyChangeListener listener) {
        propertySupport.addPropertyChangeListener(listener);
    }

    public void removePropertyChangeListener(PropertyChangeListener listener) {
        propertySupport.removePropertyChangeListener(listener);
    }

}
